﻿using System;
using System.Diagnostics;
using Reflector.CodeModel;

namespace CallGraphExtractor.CecilAdapter
{
    [DebuggerDisplay("Name")]
    class MethodDeclaration : MemberDeclaration, IMethodDeclaration
    {
        #region Lifecycle

        public MethodDeclaration(Mono.Cecil.MethodDefinition methodDefinition)
            : base(methodDefinition) { }

        #endregion Lifecycle

        #region Properties

        private Mono.Cecil.MethodDefinition pMethodDefinition;
        private Mono.Cecil.MethodDefinition MethodDefinition
        {
            get
            {
                if (pMethodDefinition == null)
                    pMethodDefinition = this.Adaptee as Mono.Cecil.MethodDefinition;
                return pMethodDefinition;
            }
        }

        #endregion Properties

        #region IMethodDeclaration Members

        public bool Abstract
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public object Body
        {
            get
            {
                if (this.MethodDefinition.Body == null)
                    return null;
                else
                    return new MethodBody(this.MethodDefinition.Body);
            }
            set { throw new NotSupportedException(); }
        }

        public bool Final
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool HideBySignature
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool NewSlot
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public IMethodReferenceCollection Overrides
        {
            get { throw new System.NotImplementedException(); }
        }

        public bool RuntimeSpecialName
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool SpecialName
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool Static
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool Virtual
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public MethodVisibility Visibility
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        #endregion

        #region IMethodReference Members

        public IMethodReference GenericMethod
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public IMethodDeclaration Resolve()
        {
            throw new System.NotImplementedException();
        }

        #endregion

        #region IMetadataItem Members

        public int Token
        {
            get { throw new System.NotImplementedException(); }
        }

        #endregion

        #region IMethodSignature Members

        public MethodCallingConvention CallingConvention
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool ExplicitThis
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public bool HasThis
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        public IParameterDeclarationCollection Parameters
        {
            get { return new ParameterDeclarationCollection(this.MethodDefinition.Parameters); }
        }

        public IMethodReturnType ReturnType
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
                throw new System.NotImplementedException();
            }
        }

        #endregion

        #region IGenericArgumentProvider Members

        public ITypeCollection GenericArguments
        {
            get { throw new System.NotImplementedException(); }
        }

        #endregion
    }
}
